<template>
   <el-dialog title="合伙人详情" :visible.sync="visible" :close-on-click-modal="false" width="70%" top="10vh">
    <div class="sketch_content">
      <el-form :model="form" label-width="120px" ref="dataForm">
        <el-row>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="姓名:" prop="name">
              <span>{{form.name}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="手机号:" prop="mobile">
              <span>{{form.mobile}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="邮箱:" prop="email">
              <span>{{form.email}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="个人头像:" prop="icon">
              <span v-for="(value, index) in iconList" :key="index">
                <el-image style="margin-right:5px" class="etc-image" :preview-src-list="iconList" :src="value" lazy/>
              </span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="公司图片:" prop="logos">
              <span v-for="(value, index) in logosList" :key="index">
                <el-image style="margin-right:5px" class="etc-image" :preview-src-list="logosList" :src="value" lazy/>
              </span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="状态:" prop="status">
              <span v-if="form.status === 0">禁用</span>
              <span v-if="form.status === 1">正常</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="省份:" prop="provinceId">
              <span>{{form.provinceName}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="城市:" prop="cityId">
              <span>{{form.cityName}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="区域:" prop="areaId">
              <span>{{form.areaName}}</span>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="8">
            <el-form-item label="创建时间:" prop="createTime">
              <span>{{form.createTime}}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="个人描述">
            <span v-html="form.perDescription"></span>
          </el-form-item>
        </el-row>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" icon="el-icon-close" @click.native="visible = false">关闭</el-button>
    </span>
  </el-dialog>

</template>

<script>
  export default {
    data () {
      return {
        visible: false,
        iconList: [],
        logosList: [],
        form: {}
      }
    },
    methods: {
      init (id) {
        this.form = {}
        this.visible = true
        if (id) {
          this.httpGet(`/partner/info/${id}`).then(res => {
            this.form = res.data
            this.iconList = this.form.icon.split(',')
            this.logosList = this.form.logos.split(',')
          })
        }
      }
    }
  }
</script>

